# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=ocrmypdf
pkgver=13.6.0
pkgrel=0
pkgdesc="Add OCR text layer to scanned PDF files"
url="https://github.com/ocrmypdf/OCRmyPDF"
arch="noarch"
license="MIT"
options="!check" # missing pytest modules
depends="
	ghostscript
	jbig2enc
	leptonica
	pngquant
	py3-coloredlogs
	py3-img2pdf
	py3-packaging
	py3-pdfminer
	py3-pikepdf
	py3-pillow
	py3-pluggy
	py3-reportlab
	py3-tqdm
	python3
	qpdf
	tesseract-ocr
	unpaper
	"
makedepends="py3-setuptools py3-setuptools_scm py3-setuptools-scm-git-archive"
checkdepends="py3-pytest py3-pytest-cov py3-pytest-xdist"
source="https://files.pythonhosted.org/packages/source/o/ocrmypdf/ocrmypdf-$pkgver.tar.gz"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
5f4c77719a82472c028c21f0617f36b273c7b5403a89f1473eb528d9cbda8e1733f8a33104cf61dbed25c764f7005119ec5759388ea113146e1b4599630ebd34  ocrmypdf-13.6.0.tar.gz
"
